package Day04;
//猜数字小游戏
import java.util.Scanner;
public class Guessing {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int num = (int)(Math.random()*999+1);
        System.out.println(num);
        System.out.println("猜吧");
        int guess=scan.nextInt();//1
       while (guess!=num){//2
           if (guess>num){
               System.out.println("大了");
           }else{
               System.out.println("小了");
           }
           System.out.println("猜吧");
           guess = scan.nextInt();//3
       }System.out.println("对了");
    }
}
